<#include "/common/head.ftl">

<@showTitle title="${i18n.getMessage('offering')} > ${i18n.getMessage('teaching')} > ${i18n.getMessage('edit')}">
	<a href="#" onclick="cc('teacher/showCheckingAttendance.sgt?offeringId=${(offeringChecking.offering.id)!}')">${i18n.getMessage('teaching')}</a>
	- <a href="#" onclick="cc('offering/showInfoOffering.sgt?id=${(offeringChecking.offering.id)!}')">${i18n.getMessage('offering')}</a>
</@showTitle>

<div id="error" style="display:none;"></div>

<div class="content">
<form action="teacher/editOfferingChecking.sgt" validator="teacher/validateOfferingChecking.sgt" onsubmit="submitFormValidation(this); return false" onreset="$('error').hide();" >

<input type="hidden" name="id" value="${(offeringChecking.id)!}"/>
<input type="hidden" name="offeringId" value="${(offeringChecking.offering.id)!}"/>

<table id="dataTable" cellspacing="1" cellpadding="0" align="center">
		<tr>
			<td class="name"><@required/>Date:</td>
			<td><input type="text" name="date" value="${(offeringChecking.date?date)!}" style="width:200px"/><img class="calendarImg" src="images/calendar/calendar.gif" onclick="displayCalendar(document.forms[0].date, '${i18n.getMessage('format.date')}', this)"/></td>
		</tr>
		<tr>
			<td class="name"><@required/>In:</td>
			<td><input type="text" name="startTime" value="${(offeringChecking.startTime)!}" style="width:100px"/> (hh:mm)</td>
		</tr>
		<tr>
			<td class="name"><@required/>Out:</td>
			<td><input type="text" name="endTime" value="${(offeringChecking.endTime)!}" style="width:100px"/> (hh:mm)</td>
		</tr>
		<tr>
			<td class="name"><@required/>Instructor:</td>
			<td>
				<select name="teacherId" style="width:204px">
					<option></option>
					<optgroup label="Main Teachers">
						<#list offeringChecking.offering.instructors as teacher>	
							<option value="${teacher.id}" <#if teacher = (offeringChecking.teacher)!>selected</#if>>${(teacher.lastName)!} ${(teacher.midName)!} ${(teacher.firstName)!}</option>
						</#list>
					</optgoup>
					<optgroup label="Other Teachers">
						<#list teachers as teacher>	
							<option value="${teacher.id}" <#if teacher = (offeringChecking.teacher)!>selected</#if>>${(teacher.lastName)!} ${(teacher.midName)!} ${(teacher.firstName)!}</option>
						</#list>
					</optgoup>
				</select>
			</td>
		</tr>
		<tr>
			<td class="name">Supervisor:</td>
			<td><input type="text" name="supervisor" value="${(offeringChecking.supervisor)!}" style="width:200px"/></td>
		</tr>
		<tr>
			<td class="name" style="vertical-align:top">Note:</td>
			<td><textarea name="comment" style="width:350px;height:80px;">${(offeringChecking.comment)!}</textarea></td>
		</tr>
		<tr>
			<td class="name"></td>
			<td>
				<input type="submit" value="${i18n.getMessage('edit')}" class="button_style"/> 
				<input type="reset" value="${i18n.getMessage('reset')}" class="button_style"/> 
			</td>
		</tr>
</table>
</form>
</div>

<script>
		$('error').hide();
</script>